package com.gitee.wsl.compose.mvi.ui.snackbarhost

import androidx.compose.runtime.Stable
import com.gitee.wsl.compose.mvi.component.base.Presenter
import com.gitee.wsl.compose.mvi.modifiable.presentable.PresentableModifier
import com.gitee.wsl.compose.mvi.ui.snackbar.SnackbarPresenter

data class SnackbarHostPresenter(
    override val modifier: PresentableModifier = PresentableModifier,

    /**
     * The [Presentable] for the snackbar.
     */
    val snackbar: SnackbarPresenter = SnackbarPresenter.Default
) : Presenter<SnackbarHostPresenter>(modifier) {
    companion object {
        @Stable
        val Default = SnackbarHostPresenter()
    }

    override fun safeMerge(other: SnackbarHostPresenter) = SnackbarHostPresenter(
        modifier = modifier.merge(other.modifier),
        snackbar = snackbar.merge(other.snackbar)
    )
}